Functions List


Algebraic Operations with Vectors


+c

The function +c computes the sum between two vectors.

Parameters:

p – First vector
q – Second vector

Syntax:

(+c p q)

Example:

> (+c (xyz 1 1 1) (xyz 2 2 2))
#<xyz:3 3 3>



-c

The function -c computes the subtraction between two vectors.

Parameters:

p – First vector
q – Second vector

Syntax:

(cx p)

Example:

> (-c (xyz 1 1 1) (xyz 2 2 2))
#<xyz:-1 -1 -1>



*c

The function *c computes the multiplication between a vector and a scalar, i.e., changes the intensity of the vector.

Parameters:

p – First vector
a – Scalar

Syntax:

(*c p a)

Example:

> (*c (xyz 1 1 1) 2)
#<xyz:2 2 2>



/c

The function /c computes the division between a vector and a scalar.

Parameters:

p – First vector
a – Scalar

Syntax:

(/c p a)

Example:

> (-c (xyz 1 1 1) (xyz 2 2 2))
#<xyz:-1 -1 -1>



u0

The function u0 returns the UCS origin.

Parameters:

n/a

Syntax:

(u0)

Example:

> (u0)
#<xyz:0 0 0>



ux and -ux

The function ux returns a positive unit vector parallel to the X axis and the function -ux returns a negative unit vector parallel to the X axis.

Parameters:

n/a

Syntax:

(ux)
(-ux)

Example:

> (ux)
#<xyz:1 0 0>

> (-ux)
#<xyz:-1 0 0>



uy and -uy

The function uy returns a positive unit vector parallel to the Y axis and the function -uy returns a negative unit vector parallel to the Y axis.

Parameters:

n/a

Syntax:

(uy)
(-uy)

Example:

> (uy)
#<xyz:0 1 0>

> (-uy)
#<xyz:0 -1 0>



uz and -uz

The function uz returns a positive unit vector parallel to the Z axis and the function -uz returns a negative unit vector parallel to the Z axis.

Parameters:

n/a

Syntax:

(uz)
(-uz)

Example:

> (uz)
#<xyz:0 0 1>

> (-uz)
#<xyz:0 0 -1>



uxy and -uxy

The function uxy specifies the vector (xyz 1 1 0) and the function -uxy specifies the vector (xyz -1 -1 0).

Parameters:

n/a

Syntax:

(uxy)
(-uxy)

Example:

>(uxy)
#<xyz 1 1 0>
>(-uxy)
#<xyz -1 -1 0>



uyz and -uyz

The function uyz specifies the vector (xyz 0 1 1) and the function -uyz specifies the vector (xyz 0 -1 -1).

Parameters:

n/a

Syntax:

(uyz)
(-uyz)

Example:

>(uyz)
#<xyz 0 1 1>
>(-uyz)
#<xyz 0 -1 -1>



uxz and -uxz

The function uxz specifies the vector (xyz 1 0 1) and the function -uxz specifies the vector (xyz -1 0 -1).

Parameters:

n/a

Syntax:

(uxz)
(-uxz)

Example:

>(uxz)
#<xyz 1 0 1>
>(-uxz)
#<xyz -1 0 -1>



uxyz and -uxyz

The function uxyz specifies the vector (xyz 1 1 1) and the function -uxyz specifies the vector (xyz -1 -1 -1).

Parameters:

n/a

Syntax:

(uxyz)
(-uxyz)

Example:

>(uxyz)
#<xyz 1 1 1>
>(-uxyz)
#<xyz -1 -1 -1>



cross-c

The function cross-c computes the cross product, or vector product, between two vectors.

Parameters:

p – First vector
q – Second vector

Syntax:

(cross-c p q)

Example:

> (cross-c (xy 1 5) (xy 2 4))
#<xyz:0 0 -6>



dot-c

The function dot-c computes the dot product, or inner product, between two vectors.

Parameters:

p – First vector
q – Second vector

Syntax:

(dot-c p q)

Example:

> (dot-c (xy 1 5) (xy 2 4))
22



norm-c

Given a vector, the function norm-c will normalize the vector, i.e., the intensity of the given vector will be converted to 1, and keep its direction.

Parameters:

p – Vector

Syntax:

(norm-c p)

Example:

> (norm-c (pol 10 pi/4))
#<xyz:0.7071067811865476 0.7071067811865475 0>

> (norm-c (pol 10 0))
#<xyz:1 0 0>
Top